$_POST['action'] 的定义!!!

来源:百度知道 编辑:UC知道 时间:2024/06/05 00:48:24
index.php
--------------------------------
<form id="form1" name="form1" method="post" action="2.php?action=hello">
<label>
<input type="submit" name="Submit" value="hello" />
</label>
<input type="hidden" name="action" value="login" />
</form>
<p> </p>
<form id="form2" name="form2" method="post" action="2.php?action=word">
<label>
<input type="submit" name="Submit2" value="word" />
</label>
</form>
<p> </p>
--------------------------------------------------

2.php
-------------------------------------------------

<?

$A= "sorry";
if ($action = "hello"){

echo

改为:
<?php
$A= "sorry";
$action=$_GET['action'];
if ($action == "hello"){//这里是==
echo "hello";
}elseif ($action == "word"){
echo "word";
}
else
{
echo $A;
}
?>
如果以上的代码得不到值,请将:
$action=$_GET['action'];
改为:
$action=$_POST['action'];

我不想说的。。。是禁书目录